package com.fxz.oauth.config;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * 配置JWT相关属性
 *
 * @author Fxz
 * @version 1.0
 * @date 2021-08-04 14:53
 */
@Configuration
@ConfigurationProperties(prefix = "fxz")
public class AppProperties {

    @Setter
    @Getter
    private Jwt jwt = new Jwt();

    @Setter
    @Getter
    public static class Jwt {
        private String header = "Authorization";
        private String prefix = "Bearer";
        /**
         * 访问token的过期时间
         */
        private Long accessTokenExpireTime = 30 * 60_000L;
        /**
         * 刷新token的过期时间
         */
        private Long refreshTokenExpireTime = 30 * 24 * 3600 * 1000L;
    }
}
